package com.anxin.act.config.entity;

import com.alibaba.fastjson.JSONObject;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.anxin.framework.aspectj.lang.annotation.Excel;
import com.anxin.framework.web.entity.BaseEntity;

/**
 * 流程申请单字段对象 wf_apply_form_field
 *
 * @author jbs
 * @date 2020-03-13
 */
public class WfApplyFormField extends BaseEntity<WfApplyFormField>{
    private static final long serialVersionUID = 1L;

    /** 主键 */
    private String id;

    /** 申请单id */
    @Excel(name = "申请单id")
    private String applyFormId;

    /** 字段名称 */
    @Excel(name = "字段名称")
    private String name;

    /** 字段类型 */
    @Excel(name = "字段类型")
    private String type;

    /** 字典类型 */
    @Excel(name = "字典类型")
    private String dictType;

    /** 是否在待办展示 */
    @Excel(name = "是否在待办展示")
    private String todoShow;

    @Override
    public String getId() {
        return id;
    }

    @Override
    public void setId(String id) {
        this.id = id;
    }

    public String getApplyFormId() {
        return applyFormId;
    }

    public void setApplyFormId(String applyFormId) {
        this.applyFormId = applyFormId;
    }

    public void setName(String name){
        this.name = name;
    }

    public String getName(){
        return name;
    }
    public void setType(String type){
        this.type = type;
    }

    public String getType(){
        return type;
    }
    public void setDictType(String dictType){
        this.dictType = dictType;
    }

    public String getDictType(){
        return dictType;
    }
    public void setTodoShow(String todoShow){
        this.todoShow = todoShow;
    }

    public String getTodoShow(){
        return todoShow;
    }

    /**
     * 将对象转为JSON
     * @return
     */
    public String toJson(){
        JSONObject jsonObject = new JSONObject();
        jsonObject.put("id",this.id);
        jsonObject.put("applyFormId",this.applyFormId);
        jsonObject.put("name",this.name);
        jsonObject.put("type",this.type);
        jsonObject.put("dictType",this.dictType);
        jsonObject.put("todoShow",this.todoShow);
        return jsonObject.toJSONString();
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("applyFormId", getApplyFormId())
            .append("name", getName())
            .append("type", getType())
            .append("remark", getRemark())
            .append("dictType", getDictType())
            .append("todoShow", getTodoShow())
            .toString();
    }
}
